package com.hotel.app.controller;

import com.hotel.app.service.HotelRoomFeign;
import com.hotel.common.param.RenewRoomAdd;
import com.hotel.common.param.RoomOrderAdd;
import com.hotel.common.param.ShowMyRoom;
import com.hotel.common.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * --- 天道酬勤 ---
 *
 * @author TRC
 * @date 2024/6/17
 * @desc
 */
@Api(value = "酒店房间相关接口")
@RestController
@RequestMapping("/api/hotel/room")
public class HotelRoomController {

    @Autowired
    private HotelRoomFeign hotelRoomFeign;

    @ApiOperation(value = "获取房间列表")
    @RequestMapping("/show")
    public R showRoomList(@RequestParam("listType") String listType) {
        return hotelRoomFeign.showRoomList(listType);
    }

    @ApiOperation(value = "展示我的房间")
    @RequestMapping("/showUserRoom")
    public R showMyRoomList(@RequestBody ShowMyRoom showMyRoom) {
        return hotelRoomFeign.showMyRoomList(showMyRoom);
    }

    @ApiOperation(value = "获取房间评分")
    @RequestMapping("/rate")
    public R showRoomRate() {
        return hotelRoomFeign.showRoomRate();
    }

    @ApiOperation(value = "预订房间")
    @RequestMapping("/pay")
    public R payRoom(@RequestBody RoomOrderAdd roomOrderAdd) {
        return hotelRoomFeign.payRoom(roomOrderAdd);
    }

    @ApiOperation(value = "续费房间")
    @RequestMapping("/renew")
    public R renewRoom(@RequestBody RenewRoomAdd renewRoomAdd) {
        return hotelRoomFeign.renewRoom(renewRoomAdd);
    }



}
